package org.moonlight.jvm.natives.java.lang.throwable;

import lombok.Data;

/**
 *
 *
 * @author Moonlight
 * @createTime 2023/11/10 9:53
 **/
@Data
public class Throwable {

    private StackTraceElement stackTraceElement;

    public String string() {
        return String.format("%s.%s(%s:%d)",
                this.stackTraceElement.getClassName(), this.stackTraceElement.getMethodName(),
                this.stackTraceElement.getFileName(), this.stackTraceElement.getLineNumber());
    }

    @Data
    public static class StackTraceElement {
        private String fileName;
        private String className;
        private String methodName;
        private int lineNumber;
    }


}
